{% extends 'userbase.html' %}
{% block title %}旅游订单{% endblock %}
{% block head_title %}旅游订单{% endblock %}
{% block framework %}
<div class="cw1000">
	<div class="public_box pd10">
		<div class="list_title">
			<h2>旅游订单</h2>
		</div>
		<div class="public_tag">
			<ul>
				<li><a {% if order_state == '' %}class="cur"{% endif %} href="?order_state=">全部订单</a></li>
				<li><a {% if order_state == 'wzf' %}class="cur"{% endif %} href="?order_state=wzf">待付款</a></li>
                <li><a {% if order_state == 'yzf' %}class="cur"{% endif %} href="?order_state=yzf">待评价</a></li>
				<li><a {% if order_state == 'ywc' %}class="cur"{% endif %} href="?order_state=ywc">已完成</a></li>
				<div class="clear"></div>
			</ul>
		</div>
		<!-----------------景区订单---------------->
		<div class="order_list">
			<div class="column_title">
				<ul>
					<li style="width:35%;">订单信息</li>
					<li style="width:10%;">数量</li>
					<li style="width:10%;">单价</li>
					<li style="width:10%;">总价</li>
					<li style="width:20%;">订单状态</li>
					<li style="width:15%;">操作</li>
				</ul>
			</div>
			<div class="list_con">
				<ul>
                    {% for order in orders %}
                        <li>
						<div class="serial">订单编号：{{ order.order_num }}<a href="#"><i class="del"></i>删除</a></div>
						<div class="cont">
							<div class="con">
								<div class="info" style="width:35%;">
									<div class="pic"><a href="{% if order.classification == 'mp' %}
                                                                {% url 'scenicspots:scenic_detail' order.scenic_id %}
                                                              {% elif order.classification == 'hd' %}
                                                                {% url 'scenicspots:active_detail' order.scenic_id %}
                                                              {% else %}
                                                                #
                                                              {% endif %}">
                                        <img width=53 height=53 src="{{ MEDIA_URL }}{{ order.scenic_image }}" />
                                    </a></div>
									<div class="name">
										<a href="{% if order.classification == 'mp' %}
                                                                {% url 'scenicspots:scenic_detail' order.scenic_id %}
                                                              {% elif order.classification == 'hd' %}
                                                                {% url 'scenicspots:active_detail' order.scenic_id %}
                                                              {% else %}
                                                                #
                                                              {% endif %}">{{ order.order_describe|truncatechars:"20" }}</a>
										<p>下单日期：{{ order.create_time|date:"Y-m-d" }}</p>
									</div>
									<div class="clear"></div>
								</div>
								<div class="number" style="width:10%;">x{{ order.buy_num }}</div>
								<div class="price" style="width:10%;">￥{{ order.ticket_price }}</div>
								<div class="m_price" style="width:10%;"><div class="middle">￥{{ order.total_amount }}</div></div>

                                {% if order.order_state == 'wzf' %}
                                    <div class="state" style="width:20%;">
									<div class="middle">
										<p>未付款</p>
										<a href="{% url 'scenicspots:order_detail' order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="{% if order.classification == 'mp' %}
                                                            {% url 'pay:submit_order' %}?from=tickets_order&order_num={{ order.order_num }}
                                                            {% elif order.classification == 'hd' %}
                                                            {% url 'pay:submit_order' %}?from=actives_order&order_num={{ order.order_num }}
                                                            {% else %}
                                                            #
                                                            {% endif %}
                                                            ">去付款</a>
									</div>
								</div>
                                {% elif order.order_state == 'yzf' %}
                                         <div class="state" style="width:20%;">
									<div class="middle">
										<p>待评价</p>
										<a href="{% url 'scenicspots:order_detail' order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="{% url 'operation:commentspots' %}?order_num={{ order.order_num }}">评价</a>
									</div>
								</div>
                                {% else %}
                                    <div class="state" style="width:20%;">
									<div class="middle">
										<p>已完成</p>
										<a href="{% url 'scenicspots:order_detail' order.order_num %}">订单详情</a>
									</div>
								</div>
								    <div class="operation" style="width:15%;">
									<div class="middle">
										<a class="buy" href="#">申请售后</a>
									</div>
								</div>
                                {% endif %}
								<div class="clear"></div>
							</div>
						</div>
					</li>
                    {% endfor %}
				</ul>
			</div>
		</div>


	</div>
	<div class="clear"></div>
</div>
{% endblock %}